package 设计模式;

public class test{
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        Singleton obj1 = Singleton.getInstance();
        Singleton obj2 = Singleton.class.newInstance();
        if (obj1==obj2){
            System.out.println("是同一个实例");
        }else {
            System.out.println("不是同一个实例");
        }
    }

    public void sss() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        Singleton ss = (Singleton) Class.forName("").newInstance();
    }
}


